-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(router): Add new JWT authentication variants and use them #2835
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
(We can discuss whether we want to keep the blocked_email list or we can totally remove it from signup flow)
@@ -1,3 +1,6 @@ | |||
#[cfg(feature = "olap")] | |||
pub mod user; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it is going to be small enough (only a few lines), you might as well have the module defined inline instead of keeping it in a separate file.
pub mod user {
#[cfg(feature = "olap")]
pub const MAX_NAME_LENGTH: usize = 70;
#[cfg(feature = "olap")]
pub const MAX_COMPANY_NAME_LENGTH: usize = 70;
// USER ROLES
#[cfg(any(feature = "olap", feature = "oltp"))]
pub const ROLE_ID_ORGANIZATION_ADMIN: &str = "org_admin";
}
Not a necessary change however.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Once we add new APIs and new roles, this file is going to become big.
Type of Change
Description
Additional Changes
Motivation and Context
To make some routes accessible with JWT authentication
How did you test it?
Postman.
Test Cases
All the above APIs will give the following response
The following APIs will now work with jwt tokens in the authorization header.
Steps:
a. Get the JWT Token from the routes mentioned above
b. Put that token in the
Bearer Token
inAuthorization
tab of postman requestc. Hit the API, then it should work.
APIs:
Merchant Account - Retrieve
Merchant Account - Update
Payment Connector - Create
Payment Connector - Retrieve
Payment Connector - List
Payment Connector - Update
Payment Connector - Delete
Business Profile - Create
Business Profile - Retrieve
Business Profile - Update
Business Profile - List
Api Key - Create
Api Key - Retrieve
Api Key - Revoke
Api Key - List
Payments - Create
Payments - Retrieve
Payments - List
Refunds - Create
Refunds - Retrieve
Refunds - List
Checklist
cargo +nightly fmt --all
cargo clippy